import { axios as request  } from '@/utils/request'
import qs from 'qs'

export function get({params}) {
  return request({
    url: 'api/transport/wait?' + qs.stringify(params, {indices: false, encode: false}),
    method: 'get',
  })
}

export default {
  //批量指派发运
  saveBatch(params) {
    return request({
      url: 'api/transport',
      method: 'post',
      data: params
    })
  },
  updateTransport(params) {
    return request({
      url: 'api/transport/update',
      method: 'post',
      data: params
    })
  },
  //修改发运
  //签收装车 api/transport/reserved-transport
  entrucking(params) {
    return request({
      url: 'api/transport/reserved-transport',
      method: 'post',
      data: params
    })
  },
  //签收装车运单列表
  signToTransport(params) {
    return request({
      url: "api/transport/sign-to-transport",
      method: "get",
      params:params
    });
  },
  //提交验车
  verify(params) {
    return request({
      url: 'api/verify',
      method: 'post',
      data: params
    })
  },
  updataPick(params) {
    return request({
      url: 'api/pick',
      method: 'put',
      data: params
    })
  },
  deleteDept(codeId) {
    return request({
      url: "api/dept/" + codeId,
      method: "DELETE"
    });
  },
  //获取验车信息
  gegGerifyData(params) {
    return request({
      url: 'api/verify/' + params,
      method: 'get',
    })
  },
  //提车入库
  inWarehouse(params) {
    return request({
      url: 'api/pick/stock/' + params.orderId,
      method: 'post',
      data: params
    })
  },
  //查询费用 api/extra-fee/{orderId}/list
  getExtraFee(orderId) {
    return request({
      url: 'api/extra-fee/' + orderId + '/list',
      method: 'get',
    })
  },
  //新增费用
  addExtraFee(params) {
    return request({
      url: 'api/extra-fee',
      method: 'post',
      data: params
    })
  },
  //修改费用
  updataExtraFee(params) {
    return request({
      url: 'api/extra-fee',
      method: 'put',
      data: params
    })
  },
  //模糊查询结算人相关信息 api/company/order/suggest
  getSuggest(params) {
    return request({
      url: 'api/company/order/suggest',
      method: 'get',
      params: params
    })
  },
  //添加公司信息 api/company/un-check
  addCompanyInfo(params) {
    return request({
      url: 'api/company/un-check',
      method: 'post',
      data: params
    })
  },
  //根据公司ID查询相关司机信息 /api/company/{companyId}/driver
  getDriver(id) {
    return request({
      url: 'api/company/' + id + '/driver',
      method: 'get'
    })
  },
  //新增司机
  addNewDriver(params) {
    return request({
      url: 'api/company/driver',
      method: 'post',
      data: params
    })
  },
  verifyReturnAddVerify(params) {
    return request({
      url: 'api/verify/returnAddVerify',
      method: 'post',
      data: params
    })
  },
  //根据网点获取信息 api/site/{id}
  getSiteInfo(id) {
    return request({
      url: 'api/site/' + id + '/user',
      method: 'get'
    })
  },
  //发运单详情
  transportDetails(id) {
    return request({
      url: 'api/transport/' + id,
      method: 'get'
    })
  },
  //获取出发地目的地
  getSdCodes(params) {
    return request({
      url: 'api/transport/sd-codes',
      method: 'get',
      params: params
    })
  },
};